<?php

class usuario extends CI_Model {

	function __construct(){
		parent::__construct();
	}

	function login($mail,$pass){
		$this->db->select('id_usuario,imagen,usuario.nombre,apellido,email,rol.nombre as tipo,id_sede');
		$this->db->from('usuario');
		$this->db->join('rol','usuario.id_rol=rol.id_rol');
		$this->db->where('email',$mail);
		$this->db->where('password',$pass);
		$this->db->limit(1);

		$query = $this->db->get();

		if ($query->num_rows() == 1) {
			$result = $query->result();
			return $result;
		}else{
			return false;
		}
	}

	}
